/**
 * 上海中赢金融信息服务有限公司
 * Copyright (c) 2017-2027 Chinazyjr,Inc.All Rights Reserved.
 */

package com.sys.midware.mongo.core.index;

/**
 * <b>ClassName:</b> Order.java <br/>
 * <b>Description:</b> TODO <br/>
 * <b>Date:</b> 2016年2月22日 下午1:33:31<br/>
 * 
 * @author mobing
 * @version
 */
public enum MongoIndexOrder {
    ASCENDING(1), DESCENDING(-1);

    private int orderValue;

    private MongoIndexOrder(int orderValue) {
        this.orderValue = orderValue;
    }

    public int getOrderValue() {
        return orderValue;
    }

    public void setOrderValue(int orderValue) {
        this.orderValue = orderValue;
    }

    public static int getOrderValue(MongoIndexOrder order) {
        int oVal = 0;
        switch (order) {
        case ASCENDING:
            oVal = 1;
            break;
        case DESCENDING:
            oVal = -1;
            break;
        }
        return oVal;
    }
}
